home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / xml / DCDWriter.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  4.5 KB  |  104 lines

  1. package com.extensibility.xml;
  2.  
  3. import java.util.Enumeration;
  4.  
  5. public class DCDWriter extends SchemaWriter implements ExportInterface {
  6.    ElemProxy elemProxy;
  7.    AttrProxy attrProxy;
  8.    EntityProxy entityProxy;
  9.    PEntityProxy pEntityProxy;
  10.    static final int DATATYPES = 1;
  11.  
  12.    public DCDWriter(SchemaIntf var1) {
  13.       super(var1, var1.getURI());
  14.    }
  15.  
  16.    public DCDWriter(SchemaIntf var1, URI var2) {
  17.       super(var1, var2);
  18.    }
  19.  
  20.    private String qualifiedAttrName(String var1) {
  21.       AttributeDeclaration var2 = (AttributeDeclaration)super.schema.getNamedDeclaration(var1, Class.forName("com.extensibility.xml.AttributeDeclaration"));
  22.       return var2 != null && var2.isGlobal() ? ((SchemaWriter)this).getQName(var1, Class.forName("com.extensibility.xml.AttributeDeclaration")) : var1;
  23.    }
  24.  
  25.    String getPrefix(int var1) {
  26.       switch (var1) {
  27.          case 1:
  28.             return "dt:";
  29.          default:
  30.             return "";
  31.       }
  32.    }
  33.  
  34.    protected SchemaWriter.DeclWriterProxyIntf createProxy(ElementDeclaration var1) {
  35.       if (this.elemProxy == null) {
  36.          this.elemProxy = new ElemProxy(this);
  37.       }
  38.  
  39.       this.elemProxy.setDecl(var1);
  40.       return this.elemProxy;
  41.    }
  42.  
  43.    protected SchemaWriter.DeclWriterProxyIntf createProxy(AttributeDeclaration var1) {
  44.       if (this.attrProxy == null) {
  45.          this.attrProxy = new AttrProxy(this);
  46.       }
  47.  
  48.       this.attrProxy.setDecl(var1);
  49.       return this.attrProxy;
  50.    }
  51.  
  52.    protected SchemaWriter.DeclWriterProxyIntf createProxy(GeneralEntityDeclaration var1) {
  53.       if (this.entityProxy == null) {
  54.          this.entityProxy = new EntityProxy(this);
  55.       }
  56.  
  57.       this.entityProxy.setDecl(var1);
  58.       return this.entityProxy;
  59.    }
  60.  
  61.    protected SchemaWriter.DeclWriterProxyIntf createProxy(ParameterEntityDeclaration var1) {
  62.       if (!(var1 instanceof InternalPEDeclaration)) {
  63.          return super.createProxy(var1);
  64.       } else {
  65.          if (this.pEntityProxy == null) {
  66.             this.pEntityProxy = new PEntityProxy(this);
  67.          }
  68.  
  69.          this.pEntityProxy.setDecl(var1);
  70.          return this.pEntityProxy;
  71.       }
  72.    }
  73.  
  74.    protected void writeHeader(SXE var1) {
  75.       var1.writeComment("Generated by XML Authority. Conforms to DCD 1.0");
  76.       var1.writeElem("DCD");
  77.       var1.writeAttr("xmlns:RDF", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
  78.    }
  79.  
  80.    protected void writeIncludes(SXE var1, Enumeration var2) {
  81.       while(var2.hasMoreElements()) {
  82.          ExternalSubset var3 = (ExternalSubset)var2.nextElement();
  83.          URI var4 = var3.getSystemURI();
  84.          var1.writeLineBreak();
  85.          var1.writeAttr(String.valueOf("xmlns:").concat(String.valueOf(((SchemaWriter)this).getPrefix(var4))), var4.toSource());
  86.       }
  87.  
  88.    }
  89.  
  90.    protected void writeNamespaces(SXE var1, Enumeration var2) {
  91.       while(var2.hasMoreElements()) {
  92.          NamespaceDeclaration var3 = (NamespaceDeclaration)var2.nextElement();
  93.          var1.writeLineBreak();
  94.          var1.writeAttr(String.valueOf("xmlns:").concat(String.valueOf(((BaseDeclaration)var3).getName())), var3.getNamespace());
  95.       }
  96.  
  97.    }
  98.  
  99.    // $FF: synthetic method
  100.    static String access$2000071(DCDWriter var0, String var1) {
  101.       return var0.qualifiedAttrName(var1);
  102.    }
  103. }
  104.